-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Added command to fix bulk checkin action log entries #16500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
PR Summary
|
|
@snipe one question: should I include doing a backup before actually updating the logs? |
|
This looks great, thank you @marcusmoore! Regarding your question, I think maybe backing up by default but allowing a |
|
Sounds good. I'll add that. |
|
@snipe added automatic backup with option to skip via |
Background
A recent PR, #16489, fixed an issue where
action_logs.created_bywas being recorded as null andaction_logs.created_atwas being recorded incorrectly when bulk checking in accessories (other bulk checkin entries recorded correctly).This PR
This PR adds a command,
snipeit:fix-bulk-accessory-action-log-entries, to fix bothcreated_atandcreated_byfor the entries mentioned above.created_atwas being recorded as~1970-01-01 00:00:01and sinceupdated_atwas recorded correctly, we can usecreated_atbeing in1970as a way to updatecreated_atto theupdated_attimestamp.created_byis a little more tricky. Since other bulk checkins were being recorded correctly, this command looks to find theuser_idby using each action log entry that has the 1970s issue mentioned above to find a matching log entry that hascreated_bypopulated. Put another way, if a user did a bulk checkin including accessories, wherecreated_atandcreated_bywould be incorrect, and the checkin also included checkins for assets, licenses, etc, we can use those entries to populatecreated_by.Example output from a dry-run: